package com.xhwl.logistics.strategy;

import com.xhwl.common.exception.BusinessException;
import com.xhwl.common.vo.cent.vehicle.CarVO;
import com.xhwl.logistics.bo.VehicleAccessRecordSecondBO;
import com.xhwl.logistics.bo.VehicleCarRecordInParkingLotBO;
import com.xhwl.logistics.bo.VehicleCarportBO;
import com.xhwl.logistics.bo.cent.VehicleIntegratedConfigBO;
import com.xhwl.logistics.bo.input.QueryVehicleAccessRecordRealtimeBO;
import com.xhwl.logistics.bo.input.QueryVehicleCarRecordInParkingLotBO;
import com.xhwl.logistics.bo.input.QueryVehicleCarportBO;
import com.xhwl.logistics.bo.manipulate.VehicleSyncBO;
import com.xhwl.logistics.dto.query.DeviceControlDTO;
import org.slf4j.LoggerFactory;

import java.util.List;

public interface IVehicleParkingLotHandler {

    void sync(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, VehicleSyncBO vehicleSyncBO);

    default void syncDevice(VehicleIntegratedConfigBO vehicleIntegratedConfigBO) {
        throw new BusinessException("该项目车场不支持同步设备，该项目集成配置信息:" + vehicleIntegratedConfigBO);
    }

    VehicleCarportBO queryCarport(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, QueryVehicleCarportBO queryVehicleCarportBO);

    default VehicleCarRecordInParkingLotBO queryCarRecordInParkingLot(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, QueryVehicleCarRecordInParkingLotBO queryVehicleCarRecordInParkingLotBO) {
        throw new BusinessException("该项目车场不支持查询在场车辆情况（queryCarRecordInParkingLot）");
    }

    default List<VehicleAccessRecordSecondBO> queryAccessRecordRealtime(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, QueryVehicleAccessRecordRealtimeBO queryVehicleAccessRecordRealtimeBO) {
        throw new BusinessException("该项目车场不支持查询实时车辆进出记录情况（queryAccessRecordRealtime）");
    }

    default void statisticsToBi(VehicleIntegratedConfigBO vehicleIntegratedConfigBO) {
        LoggerFactory.getLogger(IVehicleParkingLotHandler.class)
                .info("默认的实现汇总数据到bi（不做任何逻辑），所发生的项目id："
                        + vehicleIntegratedConfigBO.getVehicleSystemInfoBO().getProjectId()
                        + "，线程名称为：" + Thread.currentThread().getName());
    }

    //新增开闸功能
    default void openDevice(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, DeviceControlDTO deviceControlDTO){
        throw new BusinessException("该项目车场不支持对道闸进行开闸操作(openDevice)");
    }

    //道闸关闭功能
    default void closeDevice(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, DeviceControlDTO deviceControlDTO){
        throw new BusinessException("该项目车场不支持对道闸进行关闸操作(colseDevice)");
    }

    //道闸常开功能
    default void allOpenDevice(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, DeviceControlDTO deviceControlDTO){
        throw new BusinessException("该项目车场不支持对道闸进行常开操作（allOpenDevice）");
    }

    //预约访客车
    default String reserverSpace(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, CarVO carVO){
        throw new BusinessException("该项目车场不支持预约车位的功能(reserverSpace)");
    }

    //取消预约访客车
    default void cancelReserve(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, String orderNo){
        throw new BusinessException("该项目车场不支持取消车位预约的功能(cancelReserve)");
    }

    //根据车牌号查询是否存在订单
    default String getCarBillInfo(VehicleIntegratedConfigBO vehicleIntegratedConfigBO, String plateNumber){
        throw new BusinessException("该项目车场当前不支持通过车牌号查询订单信息的功能(getCarBillInfo)");
    }
}
